import axios from '@/axios'
import apiUrl from '../urls/role'

export default {

    getRoutes: () => {
        return axios.request({
            url: apiUrl.getRoutes,
            method: 'get'
        })
    },
    getRoles() {
        return axios.request({
            url: apiUrl.getRoles,
            method: 'get'
        })
    },
    addRole(data) {
        return axios.request({
            url: apiUrl.addRole,
            method: 'post',
            data
        })
    },
    updateRole(id, data) {
        return axios.request({
            url: `${apiUrl.updateRole}/${id}`,
            method: 'put',
            data
        })
    },
    deleteRole(id) {
        return axios.request({
            url: `${apiUrl.deleteRole}/${id}`,
            method: 'delete'
        })
    },

}